public class db_result_error implements db_interface_result{
	private int iErrorNum = 0;
	private String sErrDescription = "";
	db_result_error(int iErr, String sErr) {
		iErrorNum = iErr;
		sErrDescription = sErr;
	}
	
	public byte[] getBytes() {
		int iSize = 12 + sErrDescription.length();

		byte[] bHeaders = ("200 OK QDBP/1.0\nlength: " + iSize + "\n\n").getBytes();
		db_bytes oOut = new db_bytes(iSize + bHeaders.length);

		oOut.write(bHeaders);

		// Message is an error
		oOut.write(db_util.DB_RESULT_ERROR);
		
		// Error number
		oOut.write(iErrorNum);
		oOut.write(sErrDescription);
					
		return oOut.getBytes(); 
	}
}
